﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using DataCentral.BusinessDataObjects;

namespace DataCentral.UsecaseControllers
{
    public partial class MainUsecase
    {
        private LoginUsecase _UCLogin;
        private ChangePasswordUsecase _UCChangePassword;
        private ProfileUsecase _UCProfile;
        private UserBO _UserBO;
        private MainForm _FRMMain;
        //public MainUsecase(LoginUsecase _UCLogin, UserBO _UserBO, MainForm frmMain)
        //{
        //    this._UCLogin=_UCLogin;
        //    this._UserBO = _UserBO;
        //    this._FRMMain = frmMain;
        //    _UCChangePassword = new ChangePasswordUsecase();
        //    _UCProfile = new ProfileUsecase();
        //}

        public MainUsecase(LoginUsecase _UCLogin, UserBO _UserBO)
        {
            this._UCLogin = _UCLogin;
            this._UserBO = _UserBO;
            _FRMMain = new MainForm(this, _UserBO);
            _UCChangePassword = new ChangePasswordUsecase();
            _UCProfile = new ProfileUsecase();
        }

        public void StartUsecase()
        {
            _FRMMain._UCMain = this;
            _FRMMain._UserBO = _UserBO;
            _FRMMain.InitAllFormInfomation();
            _FRMMain.Show();
            
        }

        public void UserLogout()
        {
            _UCLogin.StartUsecase();
        }

        public void ShowChangePasswordForm(UserBO userBO)
        {
            _UCChangePassword.StartUsecase(userBO);
        }

        public void ShowProfileForm(UserBO userBO)
        {
            _UCProfile.StartUsecase(userBO);
        }
    }
}
